package stringtest;

/**
 * @Author: fxy
 * @Date: 2022/02/22/13:30
 * @Description:
 */
public class InternTest3 {
    public static void main(String[] args) {
        String s1 = new String("a")+new String("b");
        String s2 = new String("a")+new String("b");
        s1.intern();
        //String s4 = "ab";

        s2.intern();
        String s3 = "ab";
        System.out.println("s1"+System.identityHashCode(s1));
        System.out.println("s2"+System.identityHashCode(s2));
        System.out.println("s3"+System.identityHashCode(s3));
    }
}
